package com.ruoyi.cs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cs.domain.TBalanceChange;
import com.ruoyi.cs.mapper.TBalanceChangeMapper;
import com.ruoyi.cs.service.ITBalanceChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户余额变动Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-24
 */
@Service
public class TBalanceChangeServiceImpl implements ITBalanceChangeService
{
    @Autowired
    private TBalanceChangeMapper tBalanceChangeMapper;

    /**
     * 查询用户余额变动
     * 
     * @param id 用户余额变动主键
     * @return 用户余额变动
     */
    @Override
    public TBalanceChange selectTBalanceChangeById(Long id)
    {
        return tBalanceChangeMapper.selectTBalanceChangeById(id);
    }

    /**
     * 查询用户余额变动列表
     * 
     * @param tBalanceChange 用户余额变动
     * @return 用户余额变动
     */
    @Override
    public List<TBalanceChange> selectTBalanceChangeList(TBalanceChange tBalanceChange)
    {
        return tBalanceChangeMapper.selectTBalanceChangeList(tBalanceChange);
    }

    /**
     * 新增用户余额变动
     * 
     * @param tBalanceChange 用户余额变动
     * @return 结果
     */
    @Override
    public int insertTBalanceChange(TBalanceChange tBalanceChange)
    {
        tBalanceChange.setCreateTime(DateUtils.getNowDate());
        return tBalanceChangeMapper.insertTBalanceChange(tBalanceChange);
    }

    /**
     * 修改用户余额变动
     * 
     * @param tBalanceChange 用户余额变动
     * @return 结果
     */
    @Override
    public int updateTBalanceChange(TBalanceChange tBalanceChange)
    {
        return tBalanceChangeMapper.updateTBalanceChange(tBalanceChange);
    }

    /**
     * 批量删除用户余额变动
     * 
     * @param ids 需要删除的用户余额变动主键
     * @return 结果
     */
    @Override
    public int deleteTBalanceChangeByIds(Long[] ids)
    {
        return tBalanceChangeMapper.deleteTBalanceChangeByIds(ids);
    }

    /**
     * 删除用户余额变动信息
     * 
     * @param id 用户余额变动主键
     * @return 结果
     */
    @Override
    public int deleteTBalanceChangeById(Long id)
    {
        return tBalanceChangeMapper.deleteTBalanceChangeById(id);
    }
}
